home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_x / xcoral16.zip / BROWSER.H < prev    next >
C/C++ Source or Header  |  1993-01-15  |  4KB  |  126 lines

  1. /*
  2. ** Copyright 1989, 1992 by Lionel Fournigault
  3. **
  4. ** Permission to use, copy, and distribute for non-commercial purposes,
  5. ** is hereby granted without fee, providing that the above copyright
  6. ** notice appear in all copies and that both the copyright notice and this
  7. ** permission notice appear in supporting documentation.
  8. ** The software may be modified for your own purposes, but modified versions
  9. ** may not be distributed.
  10. ** This software is provided "as is" without any expressed or implied warranty.
  11. **
  12. **
  13. */
  14.  
  15. #ifndef _BROWSER_H_
  16. #define _BROWSER_H_
  17.  
  18. #include "text.h"
  19. #include "buffer.h"
  20. #include "scroll.h"
  21.  
  22. #define B_FONT    "-adobe-times-medium-r-normal--18-180-75-75-p-94-iso8859-1"
  23. #define B_MAP        1
  24. #define B_UNMAP        2
  25. #define B_ADD        5
  26. #define B_DEL        6
  27.  
  28. #define DEC_MODE    0
  29.  
  30. #define B_BUTTON_WIDTH     60
  31. #define B_INTER        10
  32. #define B_SPACE        5
  33.  
  34. #define W_CLASS        0
  35. #define W_PARENT    1
  36. #define W_CHILD        2
  37. #define W_METHOD    3
  38. #define W_PROC        4
  39. #define W_FILES        5
  40. #define W_VISIT        6
  41.  
  42. #define C_FIRST_WIN    4
  43. #define B_NB_WIN    7
  44.  
  45. #define W_CHAP        7
  46. #define W_SECTION    8
  47. #define W_SUBSECTION    9
  48.  
  49. #define B_BUFFER_SIZE    5000
  50.  
  51. /*
  52.  * Les Infos des fenetres de texte.
  53.  */
  54. typedef struct {
  55.     Window    frame, title, main;    /* Les fenetres principales */
  56.     int     f_width, f_height;    /* Les dimensions */
  57.     int    t_width, t_height;
  58.     int    m_width, m_height;
  59.     int     x, y;    /* La position */
  60.     Text    *text;    /* Les infos sur le texte */
  61.     Buf    *buf;    /* Le buffer */
  62.     SWin    *scroll;/* Les Infos sur le scroll */
  63.     int     select;    /* Ligne selectionnee */
  64. }BWin;
  65.  
  66. /*
  67.  * Le browser.
  68.  */
  69. typedef struct {
  70.     int        width, height;    /* Larguer hauteur du browser */
  71.     unsigned long     fg, bg, text_fg, text_bg;/* Les couleurs */
  72.     Window        frame, title, main;    /* Les fenetres principales */
  73.     char         *title_name;    /* L'objet selectionne */
  74.     Window        dec,add, del;    /* Les bouttons */
  75.     Window        edit;        /* La fenetre de visite */
  76.     BWin        tbw [7];    /* Les fenetres de texte */
  77.     Buf         *filebuf;    /* Pour les noms de fichiers */
  78.     GC        gc;        /* Le contexte graphique */
  79.     XFontStruct     *font;        /* La fonte */
  80.     int        title_height;    /* La hauteur du titre */
  81.     int        button_height;    /* la hauteur des bouttons */
  82.     unsigned long    ts, bs;        /* Les couleurs pour le 3D */
  83.     int         dec_imp_flag;    /* Toggle flag pour les methodes */
  84.     char         **methods_save;    /* Sauvegarde des divers pointeurs */
  85.     char        **class_save;
  86.     char        **files_save;
  87.     int         stat;        /* Browser mappe ou non */
  88.     int        visible;    /* Visibilite */
  89.     int        mode;        /* Le mode */
  90.        char         dir [256];    /* La directorie courante */
  91.     int        visit_raise;
  92. } Browser;
  93.  
  94. /*
  95.  * Public
  96.  */
  97. extern void     InitBrowser    ();
  98. extern void     ExtractInfos     ( /* char **name, int type */ );
  99. extern void     ConfigBrowser    ( /* int width, int height */ );
  100. extern void     ConfigVisitWindow ( /* int width, int height */ );
  101. extern void     DisplayBrowser ();
  102. extern void     UnmapBrowser ();
  103. extern void     SetBrowserMode ( /* int mode */ );
  104. extern void     ExposeBrowser ( /* XEvent *ev );
  105. extern int    ButtonBrowser ( /* XButtonEvent *ev */ );
  106. extern int    KeyPressInBrowser ( /* XKeyEvent *ev */ );
  107. extern void    ConfigScroll ( /* Bwin */ );
  108. extern void    LoadDir ( /* dirname */ );
  109. extern void    SetInfos ();
  110. extern void    RefreshBrowserControl ();
  111. extern void    SetBrowserDir ( /* dirname */ );
  112. extern int    SetBrowserVisibility ( /* event */ );
  113. extern int    GoodSuffix ( /* s */ );
  114. extern void    RefreshBrowserInfos ();
  115.  
  116. #define GetBrowserFrame()    ( br.frame )
  117. #define GetBrowserVisit()    ( br.tbw[W_VISIT].frame )
  118.  
  119. /*
  120.  * Engine
  121.  */
  122. #include "result_types.h"
  123. #include "browser_engine.h"
  124.  
  125. #endif /* _BROWSER_H_ */
  126.